<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">

<head>
<title>js第4课-02-事件-03-window.onload</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="这是js第4课-02-事件-03-window.onload">
<script>
	window.onload = function() {
		var oBtn = document.getElementById("btn1");
		//匿名函数，没有函数名称
		oBtn.onclick = function() {
			alert("匿名函数，没有函数名称");
		};
	}
</script>

</head>

<body>
	<input id="btn1" type="button" value="按钮" />
</body>

</html>